package cn.edu.cug.cs.gtl.renders.openinventor.basics;

import cn.edu.cug.cs.gtl.apis.render.basics.ViewportRegion;
import com.openinventor.inventor.SbViewportRegion;

public class ViewportRegionImpl implements ViewportRegion {
    protected SbViewportRegion nativeObject = null;

    public ViewportRegionImpl(SbViewportRegion nativeObject) {
        this.nativeObject = nativeObject;
    }

    @Override
    public Object getNativeObject() {
        return nativeObject;
    }

    @Override
    public boolean attach(Object nativeObject) {
        if(nativeObject instanceof  SbViewportRegion){
            this.nativeObject=(SbViewportRegion) nativeObject;
            return true;
        }
        return false;
    }

    @Override
    public Object detach() {
        Object r = nativeObject;
        nativeObject=null;
        return r;
    }
}
